#!/usr/bin/env python3
# -*- coding: utf-8 -*-

"""
开放商户 - 进件取消相关模型
"""

from typing import Dict, Any
from jlpay.model.base import OrgBaseReq, BaseResponse


class IncomingCancelRequest(OrgBaseReq):
    """进件取消请求"""
    
    API_URL = "/open/merch/access/incoming/cancel"
    
    def __init__(self):
        """初始化进件取消请求"""
        super().__init__()
        self.apply_id = None
    
    def set_apply_id(self, apply_id):
        """
        设置申请单号
        
        Args:
            apply_id: 申请单号
            
        Returns:
            IncomingCancelRequest实例
        """
        self.apply_id = apply_id
        return self
    
    def to_dict(self) -> Dict[str, Any]:
        """
        转换为字典格式
        
        Returns:
            字典格式的数据
        """
        data = super().to_dict()
        if self.apply_id:
            data['apply_id'] = self.apply_id
        return data


class IncomingCancelResponse(BaseResponse):
    """进件取消响应"""
    
    def __init__(self, response_dict=None):
        """
        初始化进件取消响应
        
        Args:
            response_dict: 响应字典
        """
        super().__init__(response_dict)
        # 进件取消响应只包含ret_code和ret_msg，没有其他字段
    
    def to_dict(self) -> Dict[str, Any]:
        """
        转换为字典格式
        
        Returns:
            字典格式的数据
        """
        return super().to_dict() 